Array 중복제거하는 방법 보통 filter를 주로 사용하였으나 다른 방법이 있는지 찾아보았다. # Filter const array = ['a' , 1, 2, 'a' , 'a', 3]; array.filter((item, index) => array.indexOf(item) === index); # Set const array = ['a' , 1, 2, 'a' , 'a', 3]; [...new Set(array)]; //or Array.from(new Set(array)); # Reduce const array = ['a' , 1, 2, 'a' , 'a', 3]; array..
생각없이 사용하다 질문 받게되어 foreach, for, map 에 대해 확인해보았다. # for 조건문이 충족할 떄까지 반복 수행하다 break; 만나게 되면 종료된다. for (let i=0; i 5) { break; } } /* 0 1 2 3 4 5 6 */ # forEach 배열의 모든 요소를 순회, return 없음. 외부 값이나 메소드 호출 let arr = [1,2,3,4] let result = arr.forEach(function(item) { console.log(item+1) return item+1 }) console.log(result) /* result 2 3 4 5 undefined */ # map forEach와 동일하나 return 가능. let arr = [1,2,3,4]..
# Composer 설치 # composer 설치해준다. php5.6 이상에서 사용할 수 있음. composer require webonyx/graphql-php # Core/Controller.php class Graphql_Controller extends CI_Controller { public function __construct() { parent::__construct(); } public function response($schema=null) { try{ $input = json_decode(file_get_contents('php://input'), true); $query = $input['query']; $variableValues = isset($input['variables']) ..
#MAILTO 환경 변수 Link to MAILTO 환경 변수 cron 은 MAILTO 환경 변수가 있고 공백이 아닐 경우 MAILTO 에 지정한 이메일 주소에 작업 결과를 보고합니다. #1분마다 df 의 결과를 foo@bar.com 에 보내게 됩니다. MAILTO="foo@bar.com" * * * * * df -h MAILTO 변수가 있고 값이 비어 있을 경우는 메일을 보내지 않습니다. #위와 같이 설정한 경우 df 의 결과에 대해서 메일을 보내지 않습니다. MAILTO="" * * * * * df -h MAILTO 환경 변수가 없을 경우 cron 작업의 소유자에게 메일을 전송합니다. cron 작업이 실패했을 경우에만 메일을 보내려면 MAILTO 에 수령인 정보를 설정한 후에 표준 출력(STDOU..
마크다운? Markdown은 텍스트 기반의 마크업언어로 2004년 존그루버에 의해 만들어졌으며 쉽게 쓰고 읽을 수 있으며 HTML로 변환이 가능하다. 특수기호와 문자를 이용한 매우 간단한 구조의 문법을 사용하여 웹에서도 보다 빠르게 컨텐츠를 작성하고 보다 직관적으로 인식할 수 있다. 마크다운이 최근 각광받기 시작한 이유는 깃헙(https://github.com) 덕분이다. 깃헙의 저장소Repository에 관한 정보를 기록하는 README.md는 깃헙을 사용하는 사람이라면 누구나 가장 먼저 접하게 되는 마크다운 문서였다. 마크다운을 통해서 설치방법, 소스코드 설명, 이슈 등을 간단하게 기록하고 가독성을 높일 수 있다는 강점이 부각되면서 점점 여러 곳으로 퍼져가게 된다. 1.Headers 제목 This i..
Axios 를 통해서 파일 다운로드 하기. //response blob or arraybuffer this.$axios({ method: 'post', url: url, responseType: 'blob', data: paramter }).then(res => { //header content-disposition에서 filename 추출. const name = res.headers['content-disposition'].split('filename=')[1] //IE11에서 blob처리 오류로 인해 분기처리 if (window.navigator && window.navigator.msSaveOrOpenBlob) { const blob = res.data window.navigator.msSaveO..
PHP: array_count_values - Manual PHP: array_count_values - Manual In order to apply array_map with callback checking for localised values like city name, country name, you have to provide some sort of comparison array.Here's an example of array_count_values for Polish city names. Just switch array_keys / array_values in www.php.net /* * 배열에서 유니크한 키값과 갯수 조회하기 */ $array = array(1, "hello", 1, "wor..
- Total
- Today
- Yesterday
- composite-primarykey
- 메일
- 둘이상인증한번에사용하기
- POP3
- session+token authorize
- redis
- Python
- 자바스크립트
- 테스트_다중트랜잭션
- 정의
- Laravel
- VIM-COMMAND
- laravel-test
- eloquant
- addMonth
- exception-test
- 나는욕심쟁이
- graphql
- 라라벨
- MySQL
- vim
- django
- 정규식
- composer-install
- php-composer
- composer-self-update
- addMonthWithoutOverflow
- php
- graphql-php
- php-laravel